@include('admin.common.header')
<!--tab nav start-->
<section class="panel">
    <header class="panel-heading tab-bg-dark-navy-blue ">
        <ul class="nav nav-tabs">
            <li @if ($_active['_action'] == 'list')  class="active" @endif>
                <a href="/admin/activity">活动列表</a>
            </li>
            <li @if ($_active['_action'] == 'add')  class="active" @endif>
                <a href="/admin/activity/add">添加活动</a>
            </li>
            <li @if ($_active['_action'] == 'lishi')  class="active" @endif>
                <a href="/admin/activity/?type=lishi">历史活动</a>
            </li>
            <li @if ($_active['_action'] == 'gather')  class="active" @endif>
                <a href="/admin/activity/gather">活动合集</a>
            </li>
        </ul>
    </header>
    <div class="panel-body">
        <div class="tab-content">
            <div class="row">
                <div class="col-lg-12">
                    <section class="panel">
                        @if($activity['pageData']['count'] == 0)
                            <div class="no-data">暂无要查询的内容</div>
                        @else
                            <table class="table table-striped table-advance table-hover">
                                <thead>
                                <tr>
                                    <th>ID</th>
                                    <th>标题</th>
                                    <th>图片</th>
                                    <th>花费</th>
                                    <th>人数限制</th>
                                    <th>路线</th>
                                    <th>出发地</th>
                                    <th>目的地</th>
                                    <th>时长</th>
                                    <th>活动分类</th>
                                    <th>用户</th>
                                    <th>管理</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                @foreach($activity['list'] as $a)
                                    <tr>
                                        <td>{{ $a->id }}</td>
                                        <td>{{ $a->title }}</td>
                                        <td><img width="100" src="{{ $a->img }}" alt="{{ $a->title }}"></td>
                                        <td><a href="/admin/activity/cost/{{ $a->id }}">{{ $a->cost }}</a></td>
                                        <td>{{ $a->limit_of_number }}</td>
                                        <td><a href="/admin/activity/route/{{ $a->id }}">{{ $a->route }}</a></td>
                                        <td>{{ $a->set_out }}</td>
                                        <td>{{ $a->destination }}</td>
                                        <td>{{ $a->duration }}</td>
                                        <td>{{ $a->classname }}</td>
                                        <td>{{ $a->name }}</td>
                                        <td> <a href="/admin/activity/imgslist/{{ $a->id }}" target="_blank" class="btn btn-primary btn-xs update" gid="{{ $a->id }}">图集</a>
                                            <a href="/admin/activity/enroll/{{ $a->id }}" target="_blank" class="btn btn-primary btn-xs update" gid="{{ $a->id }}">报名</a>
                                        </td>
                                        <td>
                                            <a href="/admin/activity/edit/{{ $a->id }}" target="_blank" class="btn btn-primary btn-xs update" gid="{{ $a->id }}"><i class="icon-pencil"></i></a>
                                            <button href="/admin/activity/delete/{{ $a->id }}" class="delete btn btn-danger btn-xs"><i class="icon-trash "></i></button>
                                            <a href="/admin/activity/copy/{{ $a->id }}" target="_blank" class="btn btn-primary btn-xs update" gid="{{ $a->id }}">复制</a>
                                        </td>
                                    </tr>
                                    @endforeach
                                </tbody>
                            </table>
                        @endif
                    </section>
                </div>
            </div>
            @if($activity['pageData']['lastPage'] > 1)
                <div id="page" style="width:500px;margin: 0 auto;">
                    {!! $activity['pageData']['pageHtml'] !!}
                </div>
            @endif
        </div>
    </div>
</section>
<!--tab nav start-->

<script>

    require(['app/goods' , 'common/common'] , function (goods , common) {
        common.deleteNotice();
        common.search();
    });

</script>

<script type="text/html" id="search">
    <section class="panel">
        <div class="panel-body">
            <div class="tab-content">
                <div class="row cmxform form-horizontal tasi-form">
                    <div class="col-lg-12">
                        <section class="panel">
                            <div class="panel-body">
                                <div class="form-group ">
                                    <label for="firstname" class="control-label col-lg-2">活动标题</label>
                                    <div class="col-lg-10">
                                        <input class=" form-control form-item" name="title" type="text"  value="@if(isset($search['title'])){{ $search['title'] }}@endif"/>
                                    </div>
                                </div>
                            </div>
                            <div class="panel-body">
                                <div class="form-group ">
                                    <label for="firstname" class="control-label col-lg-2">用户</label>
                                    <div class="col-lg-10">
                                        <input class=" form-control form-item" name="user" type="text"  value="@if(isset($search['user'])){{ $search['user'] }}@endif"/>
                                    </div>
                                </div>
                            </div>
                        </section>
                    </div>
                </div>
                <div class="col-lg-12 text-center">
                    <button class="btn btn-danger search-form-submit" href="/admin/goods?type=1" type="button">搜索</button>
                </div>
            </div>
        </div>
    </section>
</script>

@include('admin.common.footer')